
#ifndef _DRUMSTICK_H_
#define _DRUMSTICK_H_

#include "common.h"

#include "Shape.h"
#include "BaseShape.h"

#include <map>
#include <string>

__BEGIN_NAMESPACE_DECL_

class DrumstickLocation
{
    public:
        friend class Drumstick;
        DrumstickLocation (double x=0.0, double y=0.0, double z=0.0,
                           double rotX=0.0, double rotY=0.0, double rotZ=0.0);
    private:
        double _x, _y, _z;
        double _rotX, _rotY, _rotZ;
};

class Drumstick : public BaseShape 
{
    public:
        // Constructor
        Drumstick();
        // Destructor
        virtual ~Drumstick();

        void addLocation (std::string locationName, 
                          const DrumstickLocation& location);
        bool removeLocation (std::string locationName);

        bool setLocation (std::string locationName);
        double getLocationX () const;
        double getLocationY () const;
        double getLocationZ () const;
        double getLocationRotX () const;
        double getLocationRotY () const;
        double getLocationRotZ () const;

        void setDisplayList (int displayList);
        int getDisplayList ();
        void setInMotion();
        bool isInMotion() const;
        void advanceState();
        virtual void draw();

    // Member variables
    protected:
        std::map <std::string, DrumstickLocation> _locationMap;
        DrumstickLocation _location;
        int _displayList;   // display list for the model associated
                            // with the drumstick
        int _aor;           // angle of rotation for the drumstick
        bool _inMotion;     // flag to tell when the drumstick is in motion
};

__END_NAMESPACE_DECL_

#endif

